#define IrrToNxVect(vector) NxVec3(vector.X, vector.Y, vector.Z) 
#define STR(x) #x

#define BEGIN_XML_READ(name, source)											\
	irr::io::IrrXMLReader* _XmlReader = irr::io::createIrrXMLReader(##source);	\
	irr::io::IrrXMLReader* name## = _XmlReader;									\
	while(_XmlReader && _XmlReader->read()) {									\
		if(reader->getNodeType() == EXN_ELEMENT) {								\

#define DECLARE_XML_LIST(name)\
	bool b##name = false;

#define BEGIN_XML_LIST(name)													\
	if(b##name) {

#define END_XML_LIST(name) \
		}\
	}\
	

#define BEGIN_FINALIZE_XML_LIST_ITEM(name) \
	if(!stricmp(STR(name), _XmlReader->getNodeName())) {\
	b##name = true; \
	
#define END_FINALIZE_XML_LIST_ITEM(name) \
	}\

#define BEGIN_XML_NODE_READ()													\
	if(0==1) {}																	\

#define BEGIN_XML_NODE(node)													\
	else if (!stricmp(node, _XmlReader->getNodeName())) {						\

#define BEGIN_XML_DATA()														\
	_XmlReader->read();															\

#define XML_DATA()																\
	strdup(_XmlReader->getNodeName())											\

#define END_XML_DATA()															\
	continue;																	\

#define XML_ATTRIBUTE(type, name)	_XmlReader->getAttributeValueAs##type(STR(name))

#define XML_ATTRIBUTE_SET(type, object, name)									\
	object##->set##name(_XmlReader->getAttributeValueAs##type(STR(name)));		\

#define END_XML_NODE()															\
}																				\

#define END_XML_READ()															\
}																				\
delete _XmlReader;																\

#define BEGIN_XML_SUBNODES()													\
	while(_XmlReader->read()) {													\
		if(0==1) {}																\

#define END_XML_SUBNODES()														\
																				\
	}																			\



#define DECLARE_MEMBER_SET(type, name)							\
	virtual __inline void set##name(##type value) { this->m##name = value; }			

#define DECLARE_MEMBER_GET(type, name)							\
	virtual __inline type get##name() { return this->m##name; }					

#define DECLARE_MEMBER_PRIVATE(type, name)						\
	type m##name;												


#define DECLARE_MEMBER(type, name) 					\
public:												\
	DECLARE_MEMBER_SET(type, name)					\
	DECLARE_MEMBER_GET(type, name)					\
protected:											\
	DECLARE_MEMBER_PRIVATE(type, name)		


	
#define DECLARE_GET_FLAG_MEMBER(type, name) 		\
public:												\
	type name##() { return this->m##name; }			\
protected:											\
	DECLARE_MEMBER_PRIVATE(type, name)


#define DECLARE_GET_MEMBER(type, name)				\
public:												\
	DECLARE_MEMBER_GET(type, name)					\
protected:											\
	DECLARE_MEMBER_PRIVATE(type, name)

#define DECLARE_SET_MEMBER(type, name)				\
public:												\
	DECLARE_MEMBER_SET(type, name)					\
protected:											\
	DECLARE_MEMBER_PRIVATE(type, name)				


#define DECLARE_INTERFACE_MEMBER_SET(type, name)				\
	virtual void set##name(##type value) = 0;								

#define DECLARE_INTERFACE_MEMBER_GET(type, name)				\
	virtual type get##name() = 0;										


#define DECLARE_INTERFACE_MEMBER(type, name) 					\
public:															\
	DECLARE_INTERFACE_MEMBER_SET(type, name)					\
	DECLARE_INTERFACE_MEMBER_GET(type, name)					


#define DECLARE_INTERFACE_GET_MEMBER(type, name)	\
public:												\
	DECLARE_INTERFACE_MEMBER_GET(type, name)		
							